#ifndef FETCHER_H_
#define FETCHER_H_

#include <curl/curl.h>
#include <string>
#include <vector>

#include "thrift/CrawlerServer.h"

namespace crawler { namespace client {
using namespace server;
class Fetcher {
 public:
  Fetcher(int interval) : interval_(interval) {}
  void AddUrl(const std::string &url) { urls_.push_back(url); }
  void SetUrls(const std::vector<std::string> &urls) { urls_ = urls; }
  void Work();
  std::vector<Page> &GetFetchedPages() { return pages_; }

 private:
  int interval_;
  std::vector<std::string> urls_;
  std::vector<Page> pages_;
};
}}

#endif

